Skip to content

Conversation

@sgindeed
Copy link
Contributor

@sgindeed sgindeed commented Oct 8, 2025

  • Implemented the Longest Palindromic Subsequence algorithm in R.
  • Uses dynamic programming to compute both length and subsequence.
  • Handles case-insensitive input for better consistency.
  • Prints the longest palindromic subsequence and its length.
  • Written in clean, modular, and readable R code.
  • Time Complexity: O(n^2)
  • Space Complexity: O(n^2)

@sgindeed sgindeed requested review from acylam and siriak as code owners October 8, 2025 12:55
@siriak siriak requested a review from Copilot October 8, 2025 20:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds an implementation of the Longest Palindromic Subsequence algorithm in R using dynamic programming. The algorithm finds the longest subsequence of characters that reads the same forwards and backwards.

  • Implements dynamic programming solution with O(n²) time and space complexity
  • Includes subsequence reconstruction to return the actual palindromic string
  • Converts input to lowercase for case-insensitive matching

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit 8c18f07 into TheAlgorithms:master Oct 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants